﻿using InstaSharp.Infrastructure;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace InstaSharp.Models
{
    public class Media3Response
    {
        /// <summary>
        /// Gets or sets the media.
        /// </summary>
        /// <value>
        /// The follows.
        /// </value>
        [JsonMapping("graphql", JsonMapping.MappingType.Class)]
        public Media2Response Data { get; set; }
    }

    public class Media2Response
    {
        /// <summary>
        /// Gets or sets the media.
        /// </summary>
        /// <value>
        /// The follows.
        /// </value>
        [JsonMapping("shortcode_media", JsonMapping.MappingType.Class)]
        public Media2 Data { get; set; }
    }

    /// <summary>
    /// The Media Object
    /// </summary>
    public class Media2
    {
        /// <summary>
        /// Gets or sets the code.
        /// </summary>
        /// <value>
        /// The identifier.
        /// </value>
        [JsonMapping("shortcode", JsonMapping.MappingType.Primitive)]
        public string Code { get; set; }

        [JsonMapping("code", JsonMapping.MappingType.Primitive)]
        public string Code2
        {
            get
            {
                return Code;
            }
            set
            {
                Code = value;
            }
        }

        /// <summary>
        /// Gets or sets the identifier.
        /// </summary>
        /// <value>
        /// The identifier.
        /// </value>
        [JsonMapping("id", JsonMapping.MappingType.Primitive)]
        public long Id { get; set; }
        /// <summary>
        /// Gets or sets the owner.
        /// </summary>
        /// <value>
        /// The owner.
        /// </value>
        [JsonMapping("owner", JsonMapping.MappingType.Class)]
        public User2 Owner { get; set; }
        /// <summary>
        /// Gets or sets the comments.
        /// </summary>
        /// <value>
        /// The comments.
        /// </value>
        [JsonMapping("edge_media_to_comment", JsonMapping.MappingType.Class)]
        public Comments Comments { get; set; }
        /// <summary>
        /// Gets or sets the comments.
        /// </summary>
        /// <value>
        /// The comments.
        /// </value>
        [JsonMapping("edge_media_preview_like", JsonMapping.MappingType.Class)]
        public Count2 Likes { get; set; }
        /// <summary>
        /// Gets or sets the caption.
        /// </summary>
        /// <value>
        /// The caption.
        /// </value>
        [JsonMapping("edge_media_to_caption", JsonMapping.MappingType.Class)]
        public Caption2 Caption { get; set; }
        /// <summary>
        /// Gets or sets the created time.
        /// </summary>
        /// <value>
        /// The created time.
        /// </value>
        [JsonMapping("taken_at_timestamp", JsonMapping.MappingType.Primitive)]
        public DateTime CreatedTime { get; set; }

        [JsonMapping("date", JsonMapping.MappingType.Primitive)]
        public DateTime CreatedTime2
        {
            get
            {
                return CreatedTime;
            }
            set
            {
                CreatedTime = value;
            }
        }

        /// <summary>
        /// Gets or sets the IsVideo.
        /// </summary>
        /// <value>
        /// </value>
        [JsonMapping("is_video", JsonMapping.MappingType.Primitive)]
        public bool IsVideo { get; set; }
        /// <summary>
        /// Gets or sets the IsAd.
        /// </summary>
        /// <value>
        /// </value>
        [JsonMapping("is_ad", JsonMapping.MappingType.Primitive)]
        public bool IsAd { get; set; }
        /// <summary>
        /// Gets or sets the comments_disabled.
        /// </summary>
        /// <value>
        /// </value>
        [JsonMapping("comments_disabled", JsonMapping.MappingType.Primitive)]
        public bool IsCommentsDisabled { get; set; }
        /// <summary>
        /// Gets or sets the video_views.
        /// </summary>
        /// <value>
        /// </value>
        [JsonMapping("video_view_count", JsonMapping.MappingType.Primitive)]
        public int VideoViews { get; set; }
        /// <summary>
        /// Gets or sets the thumbnail_src.
        /// </summary>
        /// <value>
        /// The link.
        /// </value>
        [JsonMapping("thumbnail_src", JsonMapping.MappingType.Primitive)]
        public string ThumbnailSrc { get; set; }
        /// <summary>
        /// Gets or sets the display_src.
        /// </summary>
        /// <value>
        /// The link.
        /// </value>
        [JsonMapping("display_url", JsonMapping.MappingType.Primitive)]
        public string DisplaySrc { get; set; }
        /// <summary>
        /// Gets or sets the dimensions.
        /// </summary>
        /// <value>
        /// The link.
        /// </value>
        [JsonMapping("dimensions", JsonMapping.MappingType.Class)]
        public Dimensions Dimensions { get; set; }

        /// <summary>
        /// Gets or sets the location.
        /// </summary>
        /// <value>
        /// The link.
        /// </value>
        [JsonMapping("location", JsonMapping.MappingType.Class)]
        public Location Location { get; set; }
    }
}
